package com.you.controller;


import com.you.common.Result;
import com.you.entity.Menu;
import com.you.entity.User;
import com.you.service.UserService;
import com.you.service.impl.MenuServiceImpl;
import com.you.service.impl.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 友友
 * @since 2022-10-22
 */
@RestController
@RequestMapping("/menu")
public class MenuController {

    @Autowired
    MenuServiceImpl menuService;

    @GetMapping("/menuList")
    public Result findByNo(@RequestParam Integer roleId){
        List<Menu> list = menuService.lambdaQuery().like(Menu::getMenuRight, roleId).list();
        return list.size() > 0 ? Result.suc(list):Result.fail();
    }


}

